import request from '@/utils/request'

//客户档案列表
export function getList(data) {
    return request({
      url: `/client/list`,
      method: 'post',
      data
    })
}

//全部客户档案权限
export function getPermission() {
  return request({
    url: `/client/all/permission`,
    method: 'get',
    
  })
}

//全部客户档案列表
export function getAllList(data) {
  return request({
    url: `/client/list/all`,
    method: 'post',
    data
  })
}

//查询部门列表
export function deptList() {
  return request({
    url: `/client/dept/list`,
    method: 'get',
  })
}


// 客户负责人下拉
export function responsibleSelect() {
    return request({
      url: `/responsible/person/responsibleSelect`,
      method: 'get',
      
    })
}
//运营负责人列表
export function managerSelect() {
  return request({
    url: `/client/operation/manager/list`,
    method: 'get',
    
  })
}
//负责人下拉列表
export function userList(params) {
    return request({
      url: `/responsible/person/sys/user/list`,
      method: 'get',
      params
    })
}
//添加客户档案
export function addClient(data) {
  return request({
    url: '/client',
    method: 'post',
    data
  })
}

//编辑客户档案
export function editClient(data) {
    return request({
      url: `/client`,
      method: 'put',
      data
    })
}

//查询客户档案
export function clientDetail(id) {
    return request({
      url: `/client/detail/${id}`,
      method: 'get',
    })
}



//前往管理端
export function redirect(id) {
    return request({
      url: `/anchor/sys/user/redirect/${id}`,
      method: 'get',
    })
}

//查询客户渠道列表
export function sourceList() {
  return request({
    url: `/client/source/list`,
    method: 'get',
  })
}

//查看 - 客户资料
export function clientInfo(id) {
  return request({
    url: `/client/info/${id}`,
    method: 'get',
  })
}

// 查看 - 客户信息
export function clientBase(id) {
  return request({
    url: `/client/info/base/${id}`,
    method: 'get',
  })
}

//查看 - 跟进记录列表
export function followList(params) {
  return request({
    url: `/client/follow/list`,
    method: 'get',
    params
  })
}

// 查看 - 回款记录列表
export function recordList(params) {
  return request({
    url: `/client/receipt/record/list`,
    method: 'get',
    params
  })
}

//查看 - 添加客户回款
export function addReceipt(data) {
  return request({
    url: '/client/receipt/record/add',
    method: 'post',
    data
  })
}

//查看 - 客户名称(客户回款)
export function receiptInfo(id) {
  return request({
    url: `/client/receipt/record/detail/${id}`,
    method: 'get',
  })
}

//查看 - 服务记录列表
export function serviceList(params) {
  return request({
    url: `/client/service/item/record/list`,
    method: 'get',
    params
  })
}

//查看 - 操作记录列表
export function operList(params) {
  return request({
    url: `/client/oper/log/list`,
    method: 'get',
    params
  })
}

//查看 - 历史合同列表
export function historyList(params) {
  return request({
    url: `/client/history/contract/list`,
    method: 'get',
    params
  })
}

//查询客户档案服务信息
export function serviceInfo(id) {
  return request({
    url: `/client/service/detail/${id}`,
    method: 'get',
  })
}

//编辑客户档案服务
export function editService(data) {
  return request({
    url: `/client/update/service`,
    method: 'put',
    data
  })
}

//查看 - 绑定抖音林客账号
export function editlinke(data) {
  return request({
    url: `/client/tiktok/linke`,
    method: 'put',
    data
  })
}


//编辑客户回款权限
export function editPermission() {
  return request({
    url: `/client/receipt/record/permission`,
    method: 'get',
  })
}

//查看 - 查询客户回款信息（用于编辑）
export function recordDetail(id) {
  return request({
    url: `/client/receipt/record/update/${id}`,
    method: 'get',
  })
}

//查看 - 编辑客户回款
export function editRecord(data) {
  return request({ 
    url: `/client/receipt/record/update`,
    method: 'put',
    data
  })
}


//客户档案导出权限
export function exportPermission() {
  return request({
    url: `/client/list/export/permission`,
    method: 'get',
  })
}

//历史档案列表
export function getHistoryList(data) {
  return request({
    url: `/client/history/list`,
    method: 'post',
    data
  })
}

//删除客户档案
export function delClient(id) {
  return request({
    url: `/client/${id}`,
    method: 'DELETE',
  })
}
//关联抖音林客商户ID
export function bindLkMerchant(data) {
  return request({
    url: `/client/bind/lk/merchant`,
    method: 'post',
    data
  })
}

